namespace PayPal.AdaptivePayments
{
    using System.Web;

    public partial class PayResponse
    {
        public void Redirect()
        {
            string redirectUrl = string.Empty;

            if (PayPal.Profile.PayPalEnvironment == PayPalEnvironment.Sandbox)
            {
                redirectUrl = UrlConstants.SandboxPayRedirectUrl + this.payKey;
            }
            else
            {
                redirectUrl = UrlConstants.ProductionPayRedirectUrl + this.payKey;
            }

            HttpContext.Current.Response.Redirect(redirectUrl);
        }
    }
}
